#!/bin/bash

# 获取当前目录下的所有子目录
subdirectories=$(find . -maxdepth 1 -type d)

# 遍历每个子目录
for subdir in $subdirectories; do
    # 排除当前目录（.）和上层目录（..）
    if [ "$subdir" != "." ] && [ "$subdir" != ".." ]; then
        # 判断是否是Git目录
        if [ -d "$subdir/.git" ]; then
            echo "Directory $subdir is a Git repository."

            # 检查是否有未提交的变更
            git_status=$(git -C "$subdir" status --porcelain)
            if [ -n "$git_status" ]; then
                echo "Uncommitted changes in $subdir:"
#                echo "$git_status"
            else
                echo "No uncommitted changes in $subdir."
            fi
        else
            echo "Directory $subdir is not a Git repository."
        fi
    fi
done

